import http from '../request'

export const fileApi = {
    /** 上传头像 */
    uploadAvatar(file: File) {
        const formData = new FormData()
        formData.append('file', file)
        return http.post<string>('/upload/avatar', formData)
    },

    /** 上传空间封面 */
    uploadCover(file: File) {
        const formData = new FormData()
        formData.append('file', file)
        return http.post<string>('/upload/cover', formData)
    }
}

